﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sociedad.DAL
{
    public class UbigeoDAL
    {
        EntityConnectionSOA context = new EntityConnectionSOA();

        public List<Ubi_Departamento> Listar_Departamentos()
        {
            var lstDep = from dep in context.Ubi_Departamento
                         select dep;
            return lstDep.ToList();
        }

        public List<Ubi_Provincia> Listar_Provincias(String pCodDep)
        {
            var lstPro = from pro in context.Ubi_Provincia
                         where pro.cdep_Codigo == pCodDep
                         select pro;
            return lstPro.ToList();
        }

        public List<Ubi_Distrito> Listar_Distritos(String pCodPro, String pCodDep)
        {
            var lstDis = from dis in context.Ubi_Distrito
                         where dis.cdep_Codigo == pCodDep && dis.cpro_Codigo == pCodPro
                         select dis;
            return lstDis.ToList();
        }
    }
}
